/**
 * 
 */
package edu.gatech.oad.mule.input;

import edu.gatech.oad.mule.input.interfaces.ControllerOwner;


/**
 * Dummy method for testing Controller ownership.
 * 
 * @author Dale Avery
 * 
 */
public class DummyControllerOwner implements ControllerOwner {

	private String name;
	private InputDevice device;

	/**
	 * Constructs a new DummyControllerOwner with a given name.
	 * 
	 * @param name
	 *            The name of the DummyControllerOwner.
	 */
	public DummyControllerOwner(String name, InputDevice device) {
		this.name = name;
		this.device = device;
	}

	/**
	 * Gets for the name of this DummyControllerOwner.
	 * 
	 * @return The name of this DummyControllerOwner.
	 */
	public String getName() {
		return name;
	}

	/**
	 * Checks for equivalency between this instance of DummyControllerOwner and
	 * a given Object.
	 */
	public boolean isSameOwner(Object other) {
		if (other == null)
			return false;
		if (!(other instanceof DummyControllerOwner))
			return false;
		DummyControllerOwner test = (DummyControllerOwner) other;
		if (!this.name.equals(test.name))
			return false;
		return true;
	}
	
	@Override
	public String toString() {
		return name;
	}

	@Override
	public InputDevice getInputDevice() {
		return device;
	}
}
